"""
插入数据
"""

from pymysql import Connection

conn = Connection(
    host="localhost",
    port=3306,
    user="root",
    password="root",
    database="test",
    autocommit=True  # 自动提交事务（确认）
)
# 获取游标对象
cursor = conn.cursor()
# 执行非查询语句
cursor.execute("insert into student(id, name, age, gender) values(5, '齐琴', 61, 'man')")

# 手动确认
# conn.commit()
# 关闭连接
conn.close()
